import { observable, action, configure, computed } from 'mobx';

configure({ enforceActions: true });
class FormStore {
  @observable submitStatus = false;
  @observable resetStatus = false;
  @observable values = {};
  @action
  submit = () => {
    this.submitStatus = true;
  };
  @action
  unSubmit = () => {
    this.submitStatus = false;
  };
  @action
  reset = () => {
    this.resetStatus = true;
  };
  @action
  unReset = () => {
    this.resetStatus = false;
  };
  @action
  setValue = values => {
    this.values = {...this.values, ...values};
  };
  @computed
  get getValue(){
    return this.values;
  };
  @action
  resetModel = () => {
    this.submitStatus = false;
    this.resetStatus = false;
    this.values = {};
  };
}

export default new FormStore();
